import request from '@/utils/request'

// 获取权限
export function getPermission(params) {
  return request({
    url: '/permissions', params
  })
}

// 新增权限
export function addPermission(data) {
  return request({ url: '/permissions', method: 'post', data })
}

// 删除权限
export function deletePermission(id) {
  return request({ url: `/permissions/${id}`, method: 'delete' })
}

// 获取指定id
export function getPermissionById(id) {
  return request({ url: `/permissions/${id}` })
}

// 编辑权限
export function editPermission(data) {
  return request({ url: `/permissions/${data.id}`, data, method: 'put' })
}

// 获取权限数量
export function getPermissionTotal() {
  return request({ url: '/permissions/count' })
}
